﻿@using ProjectManagement.Models
@{
    ViewBag.Title = "MilestoneTemplate";
}
<style type="text/css">
#MilestoneTemplate{margin-top:9px;}
</style>
@(Html.Telerik().Grid<_MilestoneTemplate>()
            .Name("MilestoneTemplate")
    .DataKeys(keys => { keys.Add(item => item.ID); })
    .ToolBar(toolBar => toolBar.Template(
                @<text> 里程碑模板表： <a class="t-button t-grid-add" href="/MilestoneTemplate?MilestoneTemplate-mode=insert">
                    新增记录</a>
</text>
                ))
        .DataBinding(dataBinding =>
        {
            dataBinding.Ajax()
            .Select("_SelectIndex", "MilestoneTemplate")
            .Insert("_InsertAjaxEditing", "MilestoneTemplate")
            .Update("_SaveAjaxEditing", "MilestoneTemplate")
            .Delete("_DeleteAjaxEditing", "MilestoneTemplate");
        })
            .Columns(columns =>
            {
                columns.Bound(item => item.MilestoneName);
                columns.Bound(item => item.DateCount).Width(240);
                columns.Command(commands =>
                {
                    commands.Edit();
                    commands.Delete();
                }).Title("操作").Width(200);
            }).Resizable(r => r.Columns(true))
            .DetailView(view => view.ClientTemplate(
                Html.Telerik().TabStrip()
                    .Name("TabStrip_<#= ID #>")
                    .SelectedIndex(0)
                    .Items(items =>
                    {
                        items.Add().Text("任务模板").HtmlAttributes(new { style = "width:110px;text-align: center" }).Content(
                            Html.Telerik().Grid<_TaskTemplate>()
                                .Name("TaskTemplate_<#= ID #>")
                                .DataKeys(keys => { keys.Add(item => item.ID); })
                             
                     
                                .DataBinding(dataBinding =>
                                {
                                    dataBinding.Ajax()
                                        .Select("_SelectIndexMilestone", "TaskTemplate", new { conferenceid = "<#= ID #>" })
                                        .Insert("_InsertAjaxEditingMilestone", "TaskTemplate", new { conferenceid = "<#= ID #>" })
                                        .Update("_SaveAjaxEditingMilestone", "TaskTemplate", new { conferenceid = "<#= ID #>" })
                                        .Delete("_DeleteAjaxEditingMilestone", "TaskTemplate", new { conferenceid = "<#= ID #>" });
                                })
                                .Columns(columns =>
                                {
                                    columns.Bound(item => item.Name);
                                    columns.Bound(item => item.DateCount).Width(240);
                                    columns.Command(commands =>
                                    {
                                        commands.Edit();
                                        commands.Delete();
                                    }).Title("操作").Width(200);
                                })
                                .Editable(editing => editing.Mode(GridEditMode.PopUp)).ToolBar(tb => tb.Insert())
                                .Pageable(paging => paging.Style(GridPagerStyles.Status).PageOnScroll(true).PageSize(30))
                                .Scrollable(s => s.Height(300))
                                .Sortable()
                                .ToHtmlString()

                            );
                    })
                            .ToHtmlString()
                    ))
                        .Editable(editing => editing.Mode(GridEditMode.PopUp))
            .Pageable(paging => paging.Style(GridPagerStyles.Status).PageOnScroll(true).PageSize(30))
        .Scrollable(c => c.Height("560px"))
        .Sortable()
        .Resizable(resizing => resizing.Columns(true))
        
        )
<script type="text/javascript">



</script>
